package com.example.demo.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 用户表
 * </p>
 *
 * @author lst
 * @since 2019-12-17
 */
@TableName("sys_user")
@Data
public class User extends BasePlusEntity<User> {

    private static final long serialVersionUID = 1L;

    /**
     * 登录名
     */
    @TableField("login_name")
    private String loginName;
    /**
     * 密码
     */
    @TableField("password")
    private String password;
    /**
     * 用户的真实姓名
     */
    @TableField("user_name")
    private String userName;
    /**
     * 身份证号码
     */
    @TableField("id_card")
    private String idCard;
    /**
     * 民族
     */
    private String nation;
    /**
     * 性别
     */
    private String sex;
    /**
     * 生日
     */
    private String birthday;
    /**
     * 政治面貌
     */
    @TableField("politics_face")
    private String politicsFace;
    /**
     * 头像地址
     */
    @TableField("head_picture")
    private String headPicture;
    /**
     * 用户状态
     */
    @TableField("user_status")
    private String userStatus;
    /**
     * 职称
     */
    private String title;
    /**
     * 办公室
     */
    @TableField("office_addr")
    private String officeAddr;
    /**
     * 办公电话
     */
    @TableField("office_phone")
    private String officePhone;
    /**
     * 用户所在单位列表
     */
    @TableField("user_orgs")
    private String userOrgs;
    /**
     * 用户所在单位
     */
    @TableField("user_org")
    private String userOrg;
    /**
     * 手机号码
     */
    @TableField("mobil_phone")
    private String mobilPhone;
    /**
     * 邮件
     */
    private String email;
    /**
     * 备用手机
     */
    @TableField("mobil_phone2")
    private String mobilPhone2;
    /**
     * 虚拟短号
     */
    @TableField("virtual_num")
    private String virtualNum;

    /**
     * 打印表单时预留的窗口办理人员姓名
     */
    @TableField("print_user_name")
    private String printUserName;

    /**
     * 打印表单时预留的窗口办理人员电话
     */
    @TableField("print_phone")
    private String printPhone;

    /**
     * 最后登录时间
     */

    @TableField("last_login")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date lastLogin;

    /**
     * 登录ip.
     */
    @TableField("ip")
    private String ip;
    /**
     * 省籍
     */
    private String province;
    /**
     * 城市
     */
    private String city;
    /**
     * 详细地址
     */
    private String address;
    /**
     * 邮编
     */
    @TableField("post_code")
    private String postCode;


    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", loginName=" + loginName +
                ", password=" + password +
                ", userName=" + userName +
                ", idCard=" + idCard +
                ", nation=" + nation +
                ", sex=" + sex +
                ", birthday=" + birthday +
                ", politicsFace=" + politicsFace +
                ", headPicture=" + headPicture +
                ", userStatus=" + userStatus +
                ", title=" + title +
                ", officeAddr=" + officeAddr +
                ", officePhone=" + officePhone +
                ", userOrgs=" + userOrgs +
                ", userOrg=" + userOrg +
                ", mobilPhone=" + mobilPhone +
                ", email=" + email +
                ", mobilPhone2=" + mobilPhone2 +
                ", virtualNum=" + virtualNum +
                ", province=" + province +
                ", city=" + city +
                ", address=" + address +
                ", postCode=" + postCode +
                "}";
    }
}
